#include "Set.h"
#include "IVisitor.h"

Set::Set(const ExprTypeList& elts, int nodeId):
    exprType(nodeId),
    _elts(elts)
{
}
    
Set::~Set()
{
    _elts.clear();
}
    
Ast::AstTypes Set::type() const
{
    return Ast::Set;
}
    

ExprTypeList Set::elts()
{
    return _elts;
}

void Set::setElts(const ExprTypeList& elts)
{
    _elts = elts;
}

    
QString Set::toString() const
{
    return QString("Set[elts=%1]").
                arg(_elts.toString());
}
    
void Set::accept(IVisitor* visitor, const SimpleNodePtr& node)
{
    visitor->visitSet(node.dynamicCast<Set>());
}
    
void Set::traverse(IVisitor* visitor)
{
    _elts.traverse(visitor);
}